#include <bits/stdc++.h>
using namespace std;

void solve() {
    int n, a, b;
    cin >> n >> a >> b;
    int ta = a, tb = b;
    int mi = n, mx = n;
    while(mi > 1 && tb--) {
        mi = (mi + 1) / 2;
    } 
    while(mi && ta--) {
        mi /= 2;
    }
    while(mx && a--) {
        mx /= 2;
    }
    while(mx > 1 && b--) {
        mx = (mx + 1) / 2;
    }
    cout << mi << ' ' << mx << endl;
}

int main() {
    int t;
    cin >> t;
    while(t--) solve();
    return 0;
}